<template>
  <Select :options="options" />
</template>
<script lang="ts">
  import { defineComponent, onMounted, ref } from 'vue';
  import { Select } from 'ant-design-vue';
  import { getcitylist, OptionsType } from '../commonHook';
  export default defineComponent({
    name: 'Citydropdown',
    props: {
      config: {
        type: Object as PropType<OptionsType>,
      },
    },
    components: {
      Select,
    },
    setup(props, { emit }) {
      const options = ref<any>([]);
      onMounted(async () => {
        const { customerList, sourceData } = await getcitylist(props.config);
        options.value = customerList;
        console.log('sourceData',sourceData,options)
        emit('getSourceData', sourceData);
      });
      return {
        options,
      };
    },
  });
</script>
<style lang="less" scoped></style>
